package com.example.bicycle.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.bicycle.domain.entity.RideRecord;
import com.example.bicycle.domain.mqtt.ReceiveMessageVo;
import com.example.bicycle.domain.vo.PageVo;
import com.example.bicycle.mapper.ReceiveMessageMapper;
import com.example.bicycle.service.ReceiveMessageService;
import org.springframework.stereotype.Service;

/**
 * (ReceiveMessage)表服务实现类
 *
 * @author makejava
 * @since 2023-08-09 13:56:27
 */
@Service("receiveMessageService")
public class ReceiveMessageServiceImpl extends ServiceImpl<ReceiveMessageMapper, ReceiveMessageVo> implements ReceiveMessageService {

    @Override
    public PageVo getAllReceiveList(Integer pageNum, Integer pageSize) {
        QueryWrapper<ReceiveMessageVo> queryWrapper = new QueryWrapper<>();
        queryWrapper.orderByDesc("time");
        Page page = new Page(pageNum, pageSize);
        page(page, queryWrapper);
        return new PageVo(page.getRecords(),page.getTotal());
    }
}

